package main

import "fmt"

//#link: https://leetcode-cn.com/problems/power-of-four/
func main() {
	n := 16
	fmt.Println(isPowerOfFour(n))
}

func isPowerOfFour(n int) bool {
	//numStr := fmt.Sprintf("%b", n)
	//return numStr[0]=='1'&&len(numStr)%2!=0&&n&(n-1)==0
	return n > 0 && n&(n-1) == 0 && n&0xaaaaaaaa == 0
}
